Release 10.1A: OpenEdge Data Management:
DataServer for ORACLE


Record creation

Record creation behavior differs between an OpenEdge database and an ORACLE database accessed through the DataServer. The following code fragments provide examples of the different behavior.

If you have a table called cust with a field called cust-num defined as an indexed field, and you write the following procedure:

CREATE cust.
name = "SMITH". 
cust-num = 10. 
address = "1 Main St". 

Another example of the differences between the Progress 4GL and the DataServer occurs if you write a procedure similar to the following:

DEFINE BUFFER xcust FOR cust.
CREATE cust. 
cust-num = 111. 
FIND xcust WHERE xcust.cust-num = 111.
DISPLAY xcust.  

To get the correct response from the DataServer, use the following program:

DEFINE BUFFER xcust FOR cust.
CREATE cust. 
cust-num = 111. 
VALIDATE cust. /* or RELEASE cust. */
FIND xcust WHERE xcust.cust-num = 111.
DISPLAY xcust.  

In this example, however, using a VALIDATE statement causes the DataServer to write the record to the database. The VALIDATE statement causes the DataServer to write the record that contains customer 111 to the database before the FIND statement occurs. The RELEASE statement also causes the DataServer to write the record to the database; however the RELEASE statement clears the contents of buffers.

Note: Using the ROWID function might cause a newly created record to be written earlier to an ORACLE database than to an OpenEdge database. If you do not assign values to all mandatory fields for a record, the ROWID function will fail.

This difference in behavior might also be apparent when you open a query. Newly created records might not appear in the results set of queries that you opened before you created the records. Reopen the query to access the new records.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095